<?php
class ApiController extends Controller
{
    public function actionGetImageUrl()
    {
        $jsonObj = Trans::readJsonPost();
        $postData = arrayToKV(array("svg" => $jsonObj->svg, "format" => $jsonObj->format));
        $url = Trans::sendUrlPostKV("http://localhost:54959/Home/_GetFileUrl",$postData);
        $url = "http://localhost:54959/Stat/" . $url;
        $result = new stdClass();
        $result->url = $url;
        $this->renderPartial('json', array(
            'jsonArr' => $result,
        ));
    }

    public function actionTest()
    {
        $result = null;
        $jsonObj = Trans::readJsonPost();
        $d = array(
            "id" => 100032,
            "friendIds" => array("#2$%%$^$^^31000794", 100043)
        );
        var_dump(json_encode($d, JSON_UNESCAPED_SLASHES));
        $this->renderPartial('json', array(
            'jsonArr' => $result,
            'postdata' => $jsonObj,
        ));
    }

    public function filterss()
    {
        return array(
            'postOnly - LoadSetting',
            array(
                'application.filters.AccessFilter - LoadSetting',
            ),
        );
    }
}